'use strict';

angular.module('app.project').factory('projectHttpS', ['Restangular', function(Restangular){
    return {
        //get方法  
        get_projectManager:function(functionName){
         
            return Restangular.one('ProjectManager', functionName).get();
        },
        get_tasks_info:function(project_id){
        
            return Restangular.one('ProjectManager/project_tasks_info', project_id).getList();
        },
        getAll:function(functionName){
           return Restangular.one('project',functionName).getList();
        },
        getbim:function(functionName){
            return Restangular.one('bim',functionName).get();
        },
        getuserIncomp:function(functionName){
            return Restangular.one('PersonalCenter',functionName).get();
        },
        getallTemplate:function(){
            return Restangular.one('project', 'getallTemplate').getList();
        },
        deltemplate:function(id){
           return Restangular.one('project/deltemplate/',id).get();
        },
        getMilepost:function(id){
           return Restangular.one('project/getMilepost/', id).get();
        },
        getTasks:function(id){
           return Restangular.one('project/getTasks/', id).get();
        },
        getAll1:function(functionName){
           return Restangular.one('ProjectManager',functionName).getList();
        },
        getAll2:function(functionName){
           return Restangular.one('ProjectManager',functionName).get();
        },
        getdepart:function(functionName){
           return Restangular.one('user',functionName).get();
        },
        getProjectInfo:function(project_id){
        
            return Restangular.one('ProjectManager/project_message/', project_id).get();
        },
        getUserInDepart:function(id){
           return Restangular.one('User/getUserInDepart/',id).get();
        },
        getolduser:function(id){
           return Restangular.one('ProjectManager/security_showTeam/',id).get();
        },
        getmiles:function(id){
           return Restangular.one('ProjectManager/current_milestone_inf/',id).get();
        },
        gettaskchil_list:function(id){
           return Restangular.one('ProjectManager/taskChildrenList/',id).get();  
        },
        getfile_list:function(id){
           return Restangular.one('ProjectManager/docList/',id).get();  
        },
        get_deldoc:function(id){
           return Restangular.one('document/delDocOne/',id).get();  
        },
        gettaskinf:function(id){
           return Restangular.one('ProjectManager/task_detail/',id).get();  
        },
        getUserInfo: function () {
            return Restangular.one('user', 'getUserInfo').get();
        },
        getOneSum: function (id) {
            return Restangular.one('ProjectManager/get_one_pSummary/', id).get();
        },
        // post方法
        postAll:function(functionName,data){
           return Restangular.one('project').post(functionName,data);
        },
        postAllP:function(functionName,data){
            return Restangular.one('ProjectManager').post(functionName,data);
        },
        posttask:function(functionName,data){
            return Restangular.one('PersonalCenter').post(functionName,data);
         },
        postAll1:function(functionName,data){
           return Restangular.one('ProjectManager').post(functionName,data);
        },
        addtemplate:function(con){
           return Restangular.one('project','addtemplate').post('replies',con);
        },
        editTemplateMilepost:function(con){
           return Restangular.one('project','editTemplateMilepost').post('replies',con);
        },
        postCad:function(functionName,data){
           return Restangular.one('ProjectManager').post(functionName,data);
        },   
        postCadPath:function(functionName,data){
           return Restangular.one('Document').post(functionName,data);
        },
        getcadimg: function (id) {
            return Restangular.one('ProjectManager/simple_project_doc/',id).get();
        },
        getcadprojectinfo: function (id) {
            return Restangular.one('ProjectManager/one_project_message/',id).get();
        },
    };
            
   }]);


